<style>
    .layui-form-switch {
        position: relative;
        height: 22px;
        line-height: 22px;
        min-width: 35px;
        padding: 0 5px;
        margin-top: 8px;
        border: 1px solid #d2d2d2;
        border-radius: 20px;
        cursor: pointer;
        background-color: #fff;
        -webkit-transition: .1s linear;
        transition: .1s linear;
        width: 50px;

    }
    .layui-form-onswitch {
        border-color: #5FB878;
        background-color: #5FB878;
        width: 50px;
    }
    .layui-form-onswitch i {
        left: 100%;
        margin-left: -21px;
        background-color: #fff;
    }
</style>
<form action="{:url()}" method="post" class="form_single">
    <div class="box">
      <div class="box-body">
        <div class="row">
          <div class="col-md-12">
            <div class="form-group">
              <label>游戏名称</label>
              <span class="">（游戏名称）</span>
              <input class="form-control" name="name" placeholder="请输入游戏名称" value="{$info['name']|default=''}" type="text">
            </div>
          </div>

            <div class="col-md-12">
                <div class="form-group">
                    <label>游戏简介</label>
                    <span class="">（游戏简介）</span>
                    <input class="form-control" name="intro" placeholder="请输入游戏简介" value="{$info['intro']|default=''}" type="text">
                </div>
            </div>
            <div class="col-md-12">
                <div class="form-group">
                    <label>分类</label>
                    <span class="">（游戏分类）</span>
                    <select name="category_id" class="form-control">
                        {volist name='game_category_list' id='vo'}
                        <option value="{$vo['id']}" {notempty name="info['category_id']"}{if condition="$info['category_id'] eq $vo['id']"} selected="selected" {/if}{/notempty} >{$vo['name']}</option>
                        {/volist}
                    </select>
                </div>
                <div class="col-md-12">
                    <div class="form-group">
                        <label>详情页面顶部图片</label>
                        <span class="">（请上传详情页面顶部图片）</span>
                        <br/>
                        {assign name="cover_id" value="$info.top_cover_id|default='0'" /}
                        {:widget('file/index', ['name' => 'top_cover_id', 'value' => $cover_id, 'type' => 'img'])}
                    </div>
                </div>

            <div class="col-md-12">
                <div class="form-group">
                <label>游戏logo</label>
                <span class="">（请上传游戏logo）</span>
                <br/>
                {assign name="cover_id" value="$info.cover_id|default='0'" /}
                {:widget('file/index', ['name' => 'cover_id', 'value' => $cover_id, 'type' => 'img'])}
                </div>
            </div>

            <div class="col-md-6">
                <div class="form-group">
                    <label>应用截图</label>
                    <span class="">（请上传应用截图）</span>
                    <br/>

                    {assign name="img_ids" value="$info.img_ids|default=''" /}
                    {:widget('file/index', ['name' => 'img_ids', 'value' => $img_ids, 'type' => 'imgs'])}

                </div>
            </div>
            <div class="col-md-12">
                <label class="layui-form-label">应用开关</label>
                <div>
                    {if condition="isset($info) && $info['state'] eq 1"}
                    <div class="layui-unselect layui-form-switch layui-form-onswitch onkey"   data-code="state"   ><em>ON</em><i></i></div>
                    <div class="layui-unselect layui-form-switch offkey" style="display: none" data-code="state"  ><em>OFF</em><i></i></div>
                    {else/}
                    <div class="layui-unselect layui-form-switch layui-form-onswitch onkey" data-code="state"  style="display: none" ><em>ON</em><i></i></div>
                    <div class="layui-unselect layui-form-switch offkey"  data-code="state"  ><em>OFF</em><i></i></div>
                    {/if}
                </div>
                <input type="hidden" name="state"  value="{$info['state']|default=0}"/>
            </div>

            <div class="col-md-6">
                <label class="layui-form-label">是否精华</label>
                <div>
                    {if condition="isset($info) && $info['is_top'] eq 1"}
                    <div class="layui-unselect layui-form-switch layui-form-onswitch onkey"   data-code="is_top"   ><em>ON</em><i></i></div>
                    <div class="layui-unselect layui-form-switch offkey" style="display: none" data-code="is_top"  ><em>OFF</em><i></i></div>
                    {else/}
                    <div class="layui-unselect layui-form-switch layui-form-onswitch onkey" data-code="is_top"  style="display: none" ><em>ON</em><i></i></div>
                    <div class="layui-unselect layui-form-switch offkey"  data-code="is_top"  ><em>OFF</em><i></i></div>
                    {/if}
                </div>
                <input type="hidden" name="is_top"  value="{$info['is_top']|default=0}"/>
            </div>

            <div class="col-md-6">
                <label class="layui-form-label">是否高热</label>
                <div>
                    {if condition="isset($info) && $info['is_hot'] eq 1"}
                    <div class="layui-unselect layui-form-switch layui-form-onswitch onkey"   data-code="is_hot"   ><em>ON</em><i></i></div>
                    <div class="layui-unselect layui-form-switch offkey" style="display: none" data-code="is_hot"  ><em>OFF</em><i></i></div>
                    {else/}
                    <div class="layui-unselect layui-form-switch layui-form-onswitch onkey" data-code="is_hot"  style="display: none" ><em>ON</em><i></i></div>
                    <div class="layui-unselect layui-form-switch offkey"  data-code="is_hot"  ><em>OFF</em><i></i></div>
                    {/if}
                </div>
                <input type="hidden" name="is_hot"  value="{$info['is_hot']|default=0}"/>
            </div>
           <div class="col-md-12">
            <div class="form-group">
              <label>游戏链接</label>
              <span class="">（游戏链接）</span>
              <input class="form-control" name="url" placeholder="请输入游戏链接" value="{$info['url']|default=''}" type="text">
            </div>
          </div>   
             <div class="col-md-12">
            <div class="form-group">
              <label>平台闪兑,GC转出第三方请求接口</label>
              <span class="">（平台闪兑,GC转出第三方请求接口）</span>
              <input class="form-control" name="domain_name1" placeholder="请输入平台闪兑,GC转出第三方请求接口" value="{$info['domain_name1']|default=''}" type="text">
            </div>
          </div> 
              <div class="col-md-12">
            <div class="form-group">
              <label>平台审核闪兑,GC转入结果通知第三方接口</label>
              <span class="">（平台审核闪兑,GC转入结果通知第三方接口）</span>
              <input class="form-control" name="domain_name2" placeholder="请输入平台审核闪兑,GC转入结果通知第三方接口" value="{$info['domain_name2']|default=''}" type="text">
            </div>
          </div> 
               <div class="col-md-12">
                  <div class="form-group">
                      <label>游戏介绍</label>
                      <textarea class="form-control textarea_editor" name="content" placeholder="请输入游戏介绍">{$info['content']|default=''}</textarea>
                      {:widget('editor/index', array('name'=> 'content','value'=> ''))}
                  </div>
         		 </div>
          </div>

        
      <div class="box-footer">
          
        <input type="hidden" name="id" value="{$info['id']|default='0'}"/>
        
        {include file="layout/edit_btn_group"/}
        
      </div>
        
      </div>
      </div>
</form>
<script>
    $('.onkey').click(function () {
        $(this).hide();
        $(this).next().show();
        $("input[name='"+$(this).attr('data-code')+"']").val(0);
    })
    $('.offkey').click(function () {
        $(this).hide();
        $(this).prev().show();
        $("input[name='"+$(this).attr('data-code')+"']").val(1);

    })
</script>
